package com.hl.service;

import com.hl.mapper.ZixunshiPage;
import com.hl.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class ZixunshiPageServiceImpl implements ZixunshiPageService {
    @Autowired
    private ZixunshiPage zixunshiPage;
    @Override
    public List<Consultants> consultants() {
        return zixunshiPage.consultants();
    }

    @Override
    public List<Consultants> zixunshi(Integer id) {
        return zixunshiPage.zixunshi(id);
    }

    @Override
    public List<Expertiseareas> shanchanglingyu(Integer id) {
        return zixunshiPage.shanchanglingyu(id);
    }

    @Override
    public List<QuestionsReplies> liuyanhuifu(Integer id) {
        return zixunshiPage.liuyanhuifu(id);
    }

    @Override
    public List<Userreviews> yonghupingjia(Integer id) {
        return zixunshiPage.yonghupingjia(id);
    }

    @Override
    public List<Courses> fabukecheng(Integer id) {
        return zixunshiPage.fabukecheng(id);
    }

    @Override
    public List<Consultants> getconsultantMessage(Integer pageNum, Integer pageSize) {
        return zixunshiPage.getconsultantMessage(pageNum,pageSize);
    }

    @Override
    public List<Consultants> getconsultantMessageByName(String consultantName,String areaName) {
        return zixunshiPage.getconsultantMessageByName(consultantName,areaName);
    }

    @Override
    public List<Consultantlevels> getConsultantLevelList() {
        return zixunshiPage.getConsultantLevelList();
    }

    @Override
    public int zixunshiAdd(String consultantName,String areaName,String region, String levelName, String consultantIntroduction,String path) {
        int num =zixunshiPage.zixunshiAdd(consultantName,region,levelName,consultantIntroduction,path);
        Integer consultantId = zixunshiPage.getConsultantId(consultantName);
        Integer expertiseareasId = zixunshiPage.getshanchanglingyuId(areaName);
        System.out.println("88888888888gege"+expertiseareasId);
        int num1 = zixunshiPage.zixunshishanchanglingyuAdd(consultantId,expertiseareasId);
        return num;
    }

    @Override
    public int zixunshiDelete(Integer consultantId) {
        return zixunshiPage.zixunshiDelete(consultantId);
    }

    @Override
    public int zixunshiUpdate(Integer consultantId, String consultantName, String areaName, String region, String levelName, String consultantIntroduction, String path) {
        int num =zixunshiPage.zixunshiUpdate(consultantId,consultantName,region,levelName,consultantIntroduction,path);
        System.out.println(areaName);
        Integer expertiseareasId = zixunshiPage.getshanchanglingyuId(areaName);
        System.out.println("88888888888gege"+expertiseareasId);
        int num1 = zixunshiPage.zixunshishanchanglingyuUpdate(expertiseareasId,consultantId);
        return num;
    }
}
